package com.feedgraph;



import com.feedgraph.FeedManager.BasicFeed;

import android.content.Context;
import android.widget.BaseAdapter;


public abstract class FeedAdapter extends BaseAdapter {

	protected BasicFeed mFeed;
	protected Context mContext;
	
	public FeedAdapter(Context context) {
		super();
		mContext = context;
	}
	
	public void setFeed(BasicFeed feed) {
		mFeed = feed;
		this.notifyDataSetChanged ();
	}
	
	@Override
	public int getCount () {
		if (mFeed == null) return 0;
		return mFeed.size ();
	}

	@Override
	public Object getItem (int position) {
		return mFeed.get (position);
	}

	@Override
	public long getItemId (int position) {
		return mFeed.get (position).getID ();
	}
	
	@Override
	public boolean hasStableIds() {
		return true;
	}
}
